package com.ljy.my_study.util;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lijunying
 * @date 2021/1/13 17:48
 */
public class ListUtil {

    public static List<List<Integer>> makeList(String value){
        value=value.replace("[]","[ ]");
        value=value.substring(2,value.length()-2);
        String[] array=value.split("],\\[");
        List<List<Integer>> result=new ArrayList<>();
        for(String s:array){
            List<Integer> list=new ArrayList<>();
            if(!s.trim().isEmpty()){
                String[] subArray=s.split(",");
                for(String ss:subArray){
                    list.add(Integer.valueOf(ss));
                }
            }
            result.add(list);
        }
        return result;
    }
}
